import { postRequest, postRequestList, postRequestData, postRequestJson } from '../utils/request'
export const getUserList = <T>(data?: any): Promise<IResponseList<T>> =>
  postRequestList(`/api/sop/sop/system/user/pageUser`, data)

export const getUserOptions = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestJson(`/api/sop/sop/system/user/getUserOption`, data)

export const addUser = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/system/user/saveUser`, data)

export const editUser = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequest(`/api/sop/sop/system/user/updateUser`, data)

export const delUserById = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/system/user/deleteUser`, data)

export const detailUserById = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/system/user/getUserDetail`, data)

export const updateUserStatus = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/system/user/updateStatus`, data)

export const updateUserPassword = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/system/user/updatePassword`, data)

export const resetPassword = <T>(data?: any): Promise<IResponsePost<T>> =>
  postRequestJson(`/api/sop/sop/system/user/resetPassword`, data)

//用户搜索
export const getUserListBySearch = <T>(data?: any): Promise<IResponseData<T>> =>
  postRequestJson(`/api/sop/sop/system/user/getUserOption`, data)
